<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8">
	<title>天天美印</title>
	<script type="text/javascript" src="jscolor/jscolor.js"></script>
      <script type="text/javascript" src="haima.js"></script>
      <script type="text/javascript" src="jquery.js"></script>
      <script type="text/javascript" src="hammer.min.js"></script>
      <meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1,minimum-scale=1,user-scalable=yes">

	<script type="text/javascript" src="bootstrap.min.js"></script>
	<link type="text/css" rel="stylesheet" href="common.css" />
	<link type="text/css" rel="stylesheet" href="bootstrap.min.css" />
	<style type="text/css">
		ul,li{
			padding:0;
			margin:0;
		}
		body{
			/*background:#f2f2f2;*/
		}

		/*main css*/
		#main{
			width:100%;
		}
		ul li{
			border-bottom:1px solid #c9cacb;
			font-size:0;
			padding:7px;
			position: relative;
		}
		ul li img,ul li div{
			display:inline-block;
			font-size:1.4rem;
		}
		ul li img{
			width:75px;
			vertical-align: top;
		}
		ul li div{
			vertical-align: top;
			height:75px;
		}
		ul li div span{
			display: block;
			padding-left:25px;
		}
		ul li div span:first-child{
			font-size:1.6rem;
			color:#000;
			padding-top:16px;
		}
		ul li div span:last-child{
			font-size:1.4rem;
			color:#999999;
		}
		ul li:after{
			content: '';
			position: absolute;
			background:url(arrow-right.png) center center no-repeat;
			background-size:8px 13px;
			width:20px;
			height:20px;
			right:-10px;
			width:25%;
			top:32.5px;
		}
    .nodir{
        display:none;
        text-align:center;
        color:gray;
    }
	</style>
</head>
<body>
	<!-- <div id="header">
		<div class="topbar">
			<span>我的时鲜生</span>
		</div>
	</div> -->
	<div id="main">
		<div class="nodir">你还没有自己的相册，赶快去创建吧！</div>
        <ul>

			<!-- <li>
				<img src="headImg.png" />
				<div>
					<span>手机相片</span>
					<span>1065张相片，10个视频</span>
				</div>
			</li>
			<li>
				<img src="headImg.png" />
				<div>
					<span>手机相片</span>
					<span>1065张相片，10个视频</span>
				</div>
			</li>
			<li>
				<img src="headImg.png" />
				<div>
					<span>手机相片</span>
					<span>1065张相片，10个视频</span>
				</div>
			</li> -->
		</ul>
	</div>

</body>
<script type="text/javascript">

	$(document).ready(function(){
		// $("ul li:after").css("margin-top",$("ul li img").height());
		
		// alert(111)
		// var uid = 39;
	})

	$(function(){
      var uid=api.getConfig(uid)
      //uid=3;
		$.ajax({ 
            url:"http://ttmy.len.so/app/user/getphotodir/uid/"+uid, 
            type:'get',
            dataType:'JSONP',
            jsonp:"callback",
            success: function(data){
               $("ul").html('');
                var listli = '';
               //alert(JSON.stringify(data));
	            if(data.status==1){
                    for(var i=0;i<data.info.length;i++){
	                  	var list = data.info[i];
                        appendata(list);
	                }
               
               }else{
                //api.showToast(data.info);
                //$("ul").html(data.info);
               $(".nodir").css("display","block");
               }
	            
	        }
        })    
	})
    
    function appendata(list){
        //api.log(list.name);
        //alert(1111);
        var img = 'defaultPic.png';
        if(list.num>0){
            img = 'http://7xqkvn.com1.z0.glb.clouddn.com/'+list.lastest+'?imageView2/1/w/100';
        }
        $(".nodir").css("display","none");
        listli='<li class="item" dirid="'+list.id+'">'+
        '<img class="item" dirid="'+list.id+'" src="'+img+'" />'+
        '<div class="item" dirid="'+list.id+'">'+
		'<span class="item" dirid="'+list.id+'">'+list.name+'</span>'+
        '<span class="item" dirid="'+list.id+'">'+list.num+'张相片</span>'+
        '</div>'+
        '</li>';
        $("ul").append(listli);
        
    }

 	function bindEvent () {
	  	var mc = new Hammer.Manager(document.body);
	    mc.add(new Hammer.Tap());
	    
	    mc.on("tap", function (e) {
	    	
	        var className=$(e.target).attr("class");

	        if(className=="backimg"){
	            api.closeWindow1();
	        }else if(className=="item"){
	            var folderid=$(e.target).attr("dirid");
	            api.setConfig("cloudFolderid",folderid);
             
	            api.showCloudPicList();
	        }else if(className=="advImg"){
	            api.graduateDeskCalendar();
	        }

	    });
	}
	bindEvent();
    
    function backToHere(){
        var uid=api.getConfig(uid)
        //uid=3;
        $.ajax({
               url:"http://ttmy.len.so/app/user/getphotodir/uid/"+uid,
               type:'get',
               dataType:'JSONP',
               jsonp:"callback",
               success: function(data){
               $("ul").html('');
               var listli = '';
               //alert(JSON.stringify(data));
               if(data.status==1){
               for(var i=0;i<data.info.length;i++){
               var list = data.info[i];
               appendata(list);
               }
               
               }else{
               //api.showToast(data.info);
               //$("ul").html(data.info);
               $(".nodir").css("display","block");
               }
               
               }
               })
    }
</script>
</html>